<template>
  <div class="header-box">
    <home-header :city="infoObj.city"></home-header>
    <home-swiper :swiperList="infoObj.swiperList"></home-swiper>
    <home-icons :iconList="infoObj.iconList"></home-icons>
    <home-recommend :recommend="infoObj.recommendList"></home-recommend>
    <home-weyKend :list="infoObj.weekendList"></home-weyKend>
  </div>
</template>

<script>
import HomeHeader from './components/Header.vue'
import HomeSwiper from './components/Swipers.vue'
import HomeIcons from './components/Icons.vue'
import HomeRecommend from './components/Recommend.vue'
import HomeWeyKend from './components/Weykend'

export default{
  name: 'Home',
  components: {HomeHeader, HomeSwiper, HomeIcons, HomeRecommend, HomeWeyKend},
  data () {
    return {
      infoObj: {

      }
    }
  },
  mounted () {
    this.getInfo()
  },
  methods: {
    getInfo () {
      this.$axios({
        method: 'get',
        url: 'api/index.json' // 接口地址
      }).then(res => {
        if (res.data.ret) {
          this.infoObj = res.data.data
          console.log(this.infoObj)
        }
      })
    }
  }
}

</script>

<style  scoped>
</style>
